<ion-header>
    <ion-navbar>
        <ion-title>注册</ion-title>
    </ion-navbar>
</ion-header>
<ion-content class="login-content">
    <div class="login-box">
        <form (ngSubmit)="register()" #registerForm="ngForm">
            <ion-row>
                <ion-col>
                    <ion-item-group>
                        <ion-item-divider>个人信息</ion-item-divider>
                        <ion-item>
                            <ion-label>姓名:</ion-label>
                            <ion-input type="text" placeholder="请输入姓名" name="name" [(ngModel)]="registerCredentials.user.name" required></ion-input>
                        </ion-item>
                        <ion-item>
                            <ion-label>电话:</ion-label>
                            <ion-input type="text" placeholder="请输入电话" name="phone" [(ngModel)]="registerCredentials.user.phone" required></ion-input>
                        </ion-item>
                        <ion-item>
                            <ion-label>年龄:</ion-label>
                            <ion-input type="number" placeholder="请输入年龄" name="age" [(ngModel)]="registerCredentials.user.age" required></ion-input>
                        </ion-item>
                        <ion-item>
                            <ion-label>性别:</ion-label>
                            <ion-select placeholder="请选择性别" [(ngModel)]="registerCredentials.user.gender" name="gender">
                                <ion-option value="女" selected="true">女</ion-option>
                                <ion-option value="男">男</ion-option>
                            </ion-select>
                        </ion-item>
                        <ion-item>
                            <ion-label>身份证号:</ion-label>
                            <ion-input type="text" placeholder="请输入身份证号" name="idcard" [(ngModel)]="registerCredentials.user.idcard" required></ion-input>
                        </ion-item>
                        <ion-item>
                            <ion-label>住址:</ion-label>
                            <ion-input type="text" placeholder="请输入住址" name="address" [(ngModel)]="registerCredentials.user.address" required></ion-input>
                        </ion-item>
                        <ion-item>
                            <ion-label>用户名:</ion-label>
                            <ion-input type="text" placeholder="请输入用户名" name="username" [(ngModel)]="registerCredentials.user.username" required></ion-input>
                        </ion-item>
                        <ion-item>
                            <ion-label>密码:</ion-label>
                            <ion-input type="password" placeholder="请输入密码" name="username" [(ngModel)]="registerCredentials.user.password" required></ion-input>
                        </ion-item>
                        <ion-item-divider>工厂信息</ion-item-divider>
                        <ion-item>
                            <ion-label>名称:</ion-label>
                            <ion-input type="text" placeholder="请输入工厂名称" name="factory.name" [(ngModel)]="registerCredentials.factory.name" required></ion-input>
                        </ion-item>
                        <ion-item>
                            <ion-label>工商号:</ion-label>
                            <ion-input type="text" placeholder="请输入工商号" name="factory.business_code" [(ngModel)]="registerCredentials.factory.business_code" required></ion-input>
                        </ion-item>
                        <ion-item>
                            <ion-label>法人:</ion-label>
                            <ion-input type="text" placeholder="请输入法人" name="factory.legal_person" [(ngModel)]="registerCredentials.factory.legal_person" required></ion-input>
                        </ion-item>
                        <ion-item>
                            <ion-label>规模:</ion-label>
                            <ion-input type="number" placeholder="请输入规模(人数)" name="registered_capital" [(ngModel)]="registerCredentials.factory.registered_capital" required></ion-input>
                        </ion-item>
                        <ion-item>
                            <ion-label>地址:</ion-label>
                            <ion-input type="text" placeholder="请输入住址" name="factory.address" [(ngModel)]="registerCredentials.factory.address" required></ion-input>
                        </ion-item>
                        <ion-item>
                            <ion-label>成立时间:</ion-label>
                            <ion-datetime displayFormat="YYYY-MM-DD" pickerFormat="YYYY MM DD" [(ngModel)]="registerCredentials.factory.create_time" name="create_time"></ion-datetime>
                        </ion-item>
                        <ion-item>
                            <ion-label>主营业务:</ion-label>
                            <ion-select placeholder="请选择主营业务" [(ngModel)]="registerCredentials.factory.main_business" name="gender">
                                <ion-option *ngFor="let item of MainBusiness" value="{{item.value}}">
                                    {{item.label}}
                                </ion-option>
                            </ion-select>
                        </ion-item>
                        <ion-item>
                            <ion-label>工厂类型:</ion-label>
                            <ion-select placeholder="请选择工厂类型" [(ngModel)]="registerCredentials.factory.type" name="gender">
                                <ion-option value="0" selected="true">服装厂</ion-option>
                                <ion-option value="1">加工厂</ion-option>
                            </ion-select>
                        </ion-item>
                    </ion-item-group>
                </ion-col>
            </ion-row>
            <ion-row>
                <ion-col class="signup-col">
                    <button ion-button class="submit-btn" full type="submit" [disabled]="!registerForm.form.valid">立即注册</button>
                </ion-col>
            </ion-row>
        </form>
    </div>
</ion-content>

